1. Field of the Invention
The present invention concerns an image processing method and an image processing apparatus for compressing or expanding a color gamut of a color input image or a partial region thereof in accordance with the color gamut of a color image output apparatus such as a color printer or a color display.
2. Description of the Prior Art
A color image output apparatus such as color printers or color displays cannot reproduce all of visually perceptible colors and can reproduce those colors within a limited range referred to as a color gamut. On the contrary, since color input images have no restriction for the expressible range by image data, colors out of the color gamut of the output apparatus may possibly be inputted as input images, in which processing for converting the input image within the color gamut of the output apparatus, that is, processing of compressing the color gamut of the input image (color expression range) within the color gamut of the output apparatus.
On the contrary, if the input image is contained within the color gamut of the output apparatus, it is possible to conduct a processing referred to as color gamut expansion of converting the input image to an image of higher quality by effectively utilizing the color gamut of the output apparatus, for example, by making the chroma higher.
As the prior art concerning the color gamut compression, three methods, namely, Perceptual, Saturation and Colorimetric described in International Color Consosium Format proposed by International Color Consosium have been well known (See http://www.color.org).
Perceptual is a method of changing not only the colors out of the color gamut but also the colors within the color gamut of the output apparatus using a predetermined ratio while keeping hues and compressing the color gamut toward a fixed point on a gray axis within the color gamut of the output apparatus.
Saturation is a method of clipping only the colors out of the color gamut of the output apparatus to the color gamut surface of the output apparatus toward a fixed point on a gray axis within the color gamut of the output apparatus while keeping the hue.
Colorimetric is a method of clipping only the colors out of the color gamut of the output apparatus to the color gamut surface of the output apparatus toward a gray axis in the color gamut of the output apparatus while preserving the lightness and the hue.
However, since Perceptual compresses the input image always using a predetermined ratio irrespective of the hue and the lightness of the input image, it involves a problem of compressing also the colors in the region of hue or lightness not requiring compression.
Further, since Saturation and Colorimetric also clip the colors out of the color gamut of the output apparatus to the color gamut surface of the output apparatus irrespective of the hue and the lightness of the input image, they involve a problem that when a color similar to the color after converting the color out of the color gamut of the output apparatus to the color gamut surface of the output apparatus is present in the input image of the original image in the color gamut of the output apparatus, distinguishability between the both colors is deteriorated and, if there is a gradation outside of the color gamut of the output apparatus, the gradation may possibly be lost by the processing.
Further, when the Saturation or Colorimetric is attained by a multi-dimensional DLUT interpolating calculation type color converter adapted to retrieve a multi-dimensional DLUT (Direct Look Up Table) using upper bits of the input image data as the address, and obtaining output image data by interpolating calculation of the thus read out lattice point data by using lower bits in the input image data, if the lattice point data is defined by clipping the lattice point data out of the color gamut of the output apparatus to the color gamut surface of the output apparatus, it gives rise to a problem that colors in the color gamut and in the vicinity of the color gamut surface of the output apparatus are also compressed unnecessarily.
For the problems described above, there have been proposed, for example, (1) a method of selecting a conversion system considered the most preferred among the three types of the methods described above depending on the type of originals such as photographs or graphics used for business use, (2) a method of counting the number of pixels within and outside the color gamut of the output apparatus in the input image and selecting the conversion system in accordance with the ratio between them as shown in Japanese Published Unexamined Patent Application No. Hei 6-162181 and (3) a method of counting the number of pixels within and outside of the color gamut of the output apparatus in the input image and continuously changing the compression amount in accordance with the ratio thereof as shown in Japanese Published Unexamined Patent Application No. Hei 8-274997.
However, even these methods cannot basically overcome the foregoing problems since they essentially utilize Perceptual, Saturation or Colorimetric.
Further, Japanese Published Unexamined Patent Application No. Hei 7-203234 discloses a method of dividing an uniform color space into unitary regions, determining the number of pixels contained in the input image on every unitary region and mapping an image to other unitary regions of an equal lightness in accordance with the number of pixels for the unitary region out of the color gamut of the output apparatus.
However, since the method conducts color mapping only to the unitary regions out of the color gamut of the output apparatus, color continuity is deteriorated by the color conversion in the region outside of the color gamut of the output apparatus, for example, for the gradation continuous from the inside to the outside of the color gamut of the output apparatus to bring about a problem of being incapable of expressing a desired gradation.
Japanese Published Unexamined Patent Application No. Hei 7-203234 discloses processing by dividing a color gamut into small blocks as a method of color gamut compression corresponding to visual bending of hue lines in a color stage as reported, for example, in articles 4-1 of Color Forum Japan 95 (p. 45-48) in addition to the problems described above.
However, the method involves a problem of being incapable of correcting with visual bending of hue lines within a small block and incapable of ensuring continuity between the blocks.
From the foregoing, it is an object of the present invention to attain the following features. (1) Only the region requiring color gamut compression can be put to color gamut compression depending on the distribution of an input image. (2) The direction of the color gamut compression can be controlled continuously for each of the regions. (3) The amount of the color gamut compression can be controlled continuously including clipping. (4) When color gamut compression is conducted by a color converter of a multi-dimensional DLUT interpolating calculation type, an excessively unnecessary color gamut compression can be avoided particularly upon clipping.
Another object of the present invention is to enable correction for visual bending caused by distortion of a color space in each of the regions of the color space.
The foregoing object of the present invention can be attained in accordance with a first feature by an image processing method, comprising:
an output color gamut point calculation step of determining an output color gamut point as an intersection between a base line that is a line extending from the fixed point in the color gamut of the output apparatus to the conversion target point and an output color gamut surface itself or a closed curved surface inside the color gamut of the output apparatus;
an input color gamut point calculation step of determining an input color gamut point as an intersection between the base line and an color gamut surface of the input image or the partial region thereof;
a first conversion point calculation step of determining a first conversion point on the base line using the fixed point, the output color gamut point and a first weighing coefficient;
a second conversion point calculation step of determining a second conversion point by using correction data for correcting the compressing direction or expanding direction and the first weighing coefficient; and
a final conversion point calculation step of determining a final conversion point for the conversion target point by using the first conversion point, the second conversion point and a second weighing coefficient.
The foregoing object is also attained in accordance with a second feature by an image processing method, comprising the steps of:
previously setting a correction vector for correcting visual bending of a hue line for each region of a color space; and converting the input image or the partial region thereof by using the correction vector.
The foregoing object is also attained in accordance with a third feature by an image processing method, comprising:
a correction point calculation step of calculating a correction point by correcting a conversion target point using a correction data corresponding to the conversion target point;
a compression/expansion processing step of calculating a conversion point by compressing or expanding a correction point to a point on a line connecting a fixed point in a color gamut of the output apparatus, that is determined uniquely based on the conversion target point, with the correction point; and
an inversion correction point calculation step of correcting the conversion point or the second conversion point to get the final conversion point using inverse correction data corresponding to the conversion point or the second conversion point.
In the image processing method according to the first feature of the present invention, an output color gamut point and an input color gamut point as intersections between a base line extending from a fixed point to a conversion target point and an output color gamut surface and an input color gamut surface are determined, and then a first conversion point is determined as a point on the base line in the hue keeping direction on one hand and a second conversion point is determined which can be a direction for changing the hue on the other hand, and a final conversion point is determined as a point on a segment connecting the first conversion point and the second conversion point.
Accordingly, only the region requiring the color gamut compression can be put to color gamut compression depending on the distribution of the input image by the setting for the first weighing coefficient, the correction data and the second weighing coefficient, the direction of the color gamut compression can be controlled continuously for each of the regions, and the amount of the color gamut compression including clipping can also be controlled continuously. Further, by the same setting, excessively unnecessary color gamut compression can be avoided, particularly, upon clipping in a case of conducting color gamut compression by a color converter of a multi-dimensional DLUT interpolating calculation type.
In the image processing method according to the second feature of the present invention, since the color input image or the partial region thereof is converted by using a correction vector for correcting visual bending of hue lines, set to each region of the color space, the visual bending of the hue lines in the color space can be compensated in each of the region of the color space.
In the image processing method according to the third feature of the present invention, a final conversion point can be obtained on an ideal conversion curve passing the conversion target point and the fixed point by calculating a correction point by applying correction data corresponding to the conversion target point, determining the conversion point by compressing or expanding the correction point along a line passing through the correction point and a fixed point that is determined uniquely based on the conversion target point and calculating the final conversion point by conducting correction to the conversion point by the inverse correction data corresponding to the conversion point.